/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import java.math.BigDecimal;
import org.openapitools.client.model.CampaignNegativeKeyword;
import org.openapitools.client.model.CampaignNegativeKeywordEx;
import org.openapitools.client.model.CampaignNegativeKeywordResponse;
import org.openapitools.client.model.CreateCampaignNegativeKeyword;
import org.openapitools.client.model.Error;
import org.openapitools.client.model.UpdateCampaignNegativeKeyword;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CampaignNegativeKeywordsApi {
    private ApiClient localVarApiClient;

    public CampaignNegativeKeywordsApi() {
        this(Configuration.getDefaultApiClient());
    }

    public CampaignNegativeKeywordsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for archiveCampaignNegativeKeyword
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call archiveCampaignNegativeKeywordCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords/{keywordId}"
            .replaceAll("\\{" + "keywordId" + "\\}", localVarApiClient.escapeString(keywordId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call archiveCampaignNegativeKeywordValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling archiveCampaignNegativeKeyword(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling archiveCampaignNegativeKeyword(Async)");
        }
        
        // verify the required parameter 'keywordId' is set
        if (keywordId == null) {
            throw new ApiException("Missing the required parameter 'keywordId' when calling archiveCampaignNegativeKeyword(Async)");
        }
        

        okhttp3.Call localVarCall = archiveCampaignNegativeKeywordCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        return localVarCall;

    }

    /**
     * Archives a campaign negative keyword.
     * Set the status of the specified campaign negative keyword to &#x60;archived&#x60;. Note that once the status for a keyword is set to &#x60;archived&#x60; it cannot be changed.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return CampaignNegativeKeywordResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public CampaignNegativeKeywordResponse archiveCampaignNegativeKeyword(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        ApiResponse<CampaignNegativeKeywordResponse> localVarResp = archiveCampaignNegativeKeywordWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId);
        return localVarResp.getData();
    }

    /**
     * Archives a campaign negative keyword.
     * Set the status of the specified campaign negative keyword to &#x60;archived&#x60;. Note that once the status for a keyword is set to &#x60;archived&#x60; it cannot be changed.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return ApiResponse&lt;CampaignNegativeKeywordResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CampaignNegativeKeywordResponse> archiveCampaignNegativeKeywordWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        okhttp3.Call localVarCall = archiveCampaignNegativeKeywordValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, null);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeywordResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Archives a campaign negative keyword. (asynchronously)
     * Set the status of the specified campaign negative keyword to &#x60;archived&#x60;. Note that once the status for a keyword is set to &#x60;archived&#x60; it cannot be changed.
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call archiveCampaignNegativeKeywordAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback<CampaignNegativeKeywordResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = archiveCampaignNegativeKeywordValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeywordResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for createCampaignNegativeKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param createCampaignNegativeKeyword An array of campaign negative keyword objects. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createCampaignNegativeKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<CreateCampaignNegativeKeyword> createCampaignNegativeKeyword, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = createCampaignNegativeKeyword;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createCampaignNegativeKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<CreateCampaignNegativeKeyword> createCampaignNegativeKeyword, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling createCampaignNegativeKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling createCampaignNegativeKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = createCampaignNegativeKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, createCampaignNegativeKeyword, _callback);
        return localVarCall;

    }

    /**
     * Creates one or more campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param createCampaignNegativeKeyword An array of campaign negative keyword objects. (optional)
     * @return List&lt;CampaignNegativeKeywordResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public List<CampaignNegativeKeywordResponse> createCampaignNegativeKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<CreateCampaignNegativeKeyword> createCampaignNegativeKeyword) throws ApiException {
        ApiResponse<List<CampaignNegativeKeywordResponse>> localVarResp = createCampaignNegativeKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, createCampaignNegativeKeyword);
        return localVarResp.getData();
    }

    /**
     * Creates one or more campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param createCampaignNegativeKeyword An array of campaign negative keyword objects. (optional)
     * @return ApiResponse&lt;List&lt;CampaignNegativeKeywordResponse&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<CampaignNegativeKeywordResponse>> createCampaignNegativeKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<CreateCampaignNegativeKeyword> createCampaignNegativeKeyword) throws ApiException {
        okhttp3.Call localVarCall = createCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, createCampaignNegativeKeyword, null);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordResponse>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Creates one or more campaign negative keywords. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param createCampaignNegativeKeyword An array of campaign negative keyword objects. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createCampaignNegativeKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<CreateCampaignNegativeKeyword> createCampaignNegativeKeyword, final ApiCallback<List<CampaignNegativeKeywordResponse>> _callback) throws ApiException {

        okhttp3.Call localVarCall = createCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, createCampaignNegativeKeyword, _callback);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordResponse>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getCampaignNegativeKeyword
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getCampaignNegativeKeywordCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords/{keywordId}"
            .replaceAll("\\{" + "keywordId" + "\\}", localVarApiClient.escapeString(keywordId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getCampaignNegativeKeywordValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getCampaignNegativeKeyword(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getCampaignNegativeKeyword(Async)");
        }
        
        // verify the required parameter 'keywordId' is set
        if (keywordId == null) {
            throw new ApiException("Missing the required parameter 'keywordId' when calling getCampaignNegativeKeyword(Async)");
        }
        

        okhttp3.Call localVarCall = getCampaignNegativeKeywordCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        return localVarCall;

    }

    /**
     * Gets a campaign negative keyword specified by identifier.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return CampaignNegativeKeyword
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public CampaignNegativeKeyword getCampaignNegativeKeyword(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        ApiResponse<CampaignNegativeKeyword> localVarResp = getCampaignNegativeKeywordWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId);
        return localVarResp.getData();
    }

    /**
     * Gets a campaign negative keyword specified by identifier.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return ApiResponse&lt;CampaignNegativeKeyword&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CampaignNegativeKeyword> getCampaignNegativeKeywordWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        okhttp3.Call localVarCall = getCampaignNegativeKeywordValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, null);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeyword>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a campaign negative keyword specified by identifier. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getCampaignNegativeKeywordAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback<CampaignNegativeKeyword> _callback) throws ApiException {

        okhttp3.Call localVarCall = getCampaignNegativeKeywordValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeyword>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getCampaignNegativeKeywordEx
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getCampaignNegativeKeywordExCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords/extended/{keywordId}"
            .replaceAll("\\{" + "keywordId" + "\\}", localVarApiClient.escapeString(keywordId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getCampaignNegativeKeywordExValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getCampaignNegativeKeywordEx(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getCampaignNegativeKeywordEx(Async)");
        }
        
        // verify the required parameter 'keywordId' is set
        if (keywordId == null) {
            throw new ApiException("Missing the required parameter 'keywordId' when calling getCampaignNegativeKeywordEx(Async)");
        }
        

        okhttp3.Call localVarCall = getCampaignNegativeKeywordExCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        return localVarCall;

    }

    /**
     * Gets a campaign negative keyword that has extended data fields.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return CampaignNegativeKeywordEx
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public CampaignNegativeKeywordEx getCampaignNegativeKeywordEx(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        ApiResponse<CampaignNegativeKeywordEx> localVarResp = getCampaignNegativeKeywordExWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId);
        return localVarResp.getData();
    }

    /**
     * Gets a campaign negative keyword that has extended data fields.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @return ApiResponse&lt;CampaignNegativeKeywordEx&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CampaignNegativeKeywordEx> getCampaignNegativeKeywordExWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        okhttp3.Call localVarCall = getCampaignNegativeKeywordExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, null);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeywordEx>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a campaign negative keyword that has extended data fields. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing campaign negative keyword. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getCampaignNegativeKeywordExAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback<CampaignNegativeKeywordEx> _callback) throws ApiException {

        okhttp3.Call localVarCall = getCampaignNegativeKeywordExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        Type localVarReturnType = new TypeToken<CampaignNegativeKeywordEx>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listCampaignNegativeKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listCampaignNegativeKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (startIndex != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("startIndex", startIndex));
        }

        if (count != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count));
        }

        if (matchTypeFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("matchTypeFilter", matchTypeFilter));
        }

        if (keywordText != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("keywordText", keywordText));
        }

        if (campaignIdFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignIdFilter", campaignIdFilter));
        }

        if (keywordIdFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("keywordIdFilter", keywordIdFilter));
        }

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listCampaignNegativeKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling listCampaignNegativeKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling listCampaignNegativeKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = listCampaignNegativeKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, _callback);
        return localVarCall;

    }

    /**
     * Gets a list of campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @return List&lt;CampaignNegativeKeyword&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public List<CampaignNegativeKeyword> listCampaignNegativeKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter) throws ApiException {
        ApiResponse<List<CampaignNegativeKeyword>> localVarResp = listCampaignNegativeKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter);
        return localVarResp.getData();
    }

    /**
     * Gets a list of campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @return ApiResponse&lt;List&lt;CampaignNegativeKeyword&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<CampaignNegativeKeyword>> listCampaignNegativeKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter) throws ApiException {
        okhttp3.Call localVarCall = listCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, null);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeyword>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a list of campaign negative keywords. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listCampaignNegativeKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback<List<CampaignNegativeKeyword>> _callback) throws ApiException {

        okhttp3.Call localVarCall = listCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, _callback);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeyword>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listCampaignNegativeKeywordsEx
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listCampaignNegativeKeywordsExCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords/extended";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (startIndex != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("startIndex", startIndex));
        }

        if (count != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count));
        }

        if (matchTypeFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("matchTypeFilter", matchTypeFilter));
        }

        if (keywordText != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("keywordText", keywordText));
        }

        if (campaignIdFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignIdFilter", campaignIdFilter));
        }

        if (keywordIdFilter != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("keywordIdFilter", keywordIdFilter));
        }

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listCampaignNegativeKeywordsExValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling listCampaignNegativeKeywordsEx(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling listCampaignNegativeKeywordsEx(Async)");
        }
        

        okhttp3.Call localVarCall = listCampaignNegativeKeywordsExCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, _callback);
        return localVarCall;

    }

    /**
     * Gets a list of campaign negative keywords that have extended data fields.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @return List&lt;CampaignNegativeKeywordEx&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public List<CampaignNegativeKeywordEx> listCampaignNegativeKeywordsEx(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter) throws ApiException {
        ApiResponse<List<CampaignNegativeKeywordEx>> localVarResp = listCampaignNegativeKeywordsExWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter);
        return localVarResp.getData();
    }

    /**
     * Gets a list of campaign negative keywords that have extended data fields.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @return ApiResponse&lt;List&lt;CampaignNegativeKeywordEx&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<CampaignNegativeKeywordEx>> listCampaignNegativeKeywordsExWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter) throws ApiException {
        okhttp3.Call localVarCall = listCampaignNegativeKeywordsExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, null);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordEx>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a list of campaign negative keywords that have extended data fields. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param startIndex 0-indexed record offset for the result set. (optional, default to 0)
     * @param count Number of records to include in the paged response. Defaults to max page size. (optional)
     * @param matchTypeFilter Restricts results to negative keywords with match types within the specified comma-separated list. For more information, see [match types](https://advertising.amazon.com/help#GHTRFDZRJPW6764R) in the Amazon Ads support center. (optional)
     * @param keywordText Restricts results to negative keywords that match the specified text. (optional)
     * @param campaignIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param keywordIdFilter Restricts results to negative keywords associated with campaigns specified by identifier in the comma-delimited list. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listCampaignNegativeKeywordsExAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal startIndex, BigDecimal count, String matchTypeFilter, String keywordText, String campaignIdFilter, String keywordIdFilter, final ApiCallback<List<CampaignNegativeKeywordEx>> _callback) throws ApiException {

        okhttp3.Call localVarCall = listCampaignNegativeKeywordsExValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, startIndex, count, matchTypeFilter, keywordText, campaignIdFilter, keywordIdFilter, _callback);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordEx>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateCampaignNegativeKeywords
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param updateCampaignNegativeKeyword An array of campaign negative keywords with updated values. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateCampaignNegativeKeywordsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<UpdateCampaignNegativeKeyword> updateCampaignNegativeKeyword, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = updateCampaignNegativeKeyword;

        // create path and map variables
        String localVarPath = "/v2/sp/campaignNegativeKeywords";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateCampaignNegativeKeywordsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<UpdateCampaignNegativeKeyword> updateCampaignNegativeKeyword, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling updateCampaignNegativeKeywords(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling updateCampaignNegativeKeywords(Async)");
        }
        

        okhttp3.Call localVarCall = updateCampaignNegativeKeywordsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, updateCampaignNegativeKeyword, _callback);
        return localVarCall;

    }

    /**
     * Updates one or more campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param updateCampaignNegativeKeyword An array of campaign negative keywords with updated values. (optional)
     * @return List&lt;CampaignNegativeKeywordResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public List<CampaignNegativeKeywordResponse> updateCampaignNegativeKeywords(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<UpdateCampaignNegativeKeyword> updateCampaignNegativeKeyword) throws ApiException {
        ApiResponse<List<CampaignNegativeKeywordResponse>> localVarResp = updateCampaignNegativeKeywordsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, updateCampaignNegativeKeyword);
        return localVarResp.getData();
    }

    /**
     * Updates one or more campaign negative keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param updateCampaignNegativeKeyword An array of campaign negative keywords with updated values. (optional)
     * @return ApiResponse&lt;List&lt;CampaignNegativeKeywordResponse&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<CampaignNegativeKeywordResponse>> updateCampaignNegativeKeywordsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<UpdateCampaignNegativeKeyword> updateCampaignNegativeKeyword) throws ApiException {
        okhttp3.Call localVarCall = updateCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, updateCampaignNegativeKeyword, null);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordResponse>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Updates one or more campaign negative keywords. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param updateCampaignNegativeKeyword An array of campaign negative keywords with updated values. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateCampaignNegativeKeywordsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, List<UpdateCampaignNegativeKeyword> updateCampaignNegativeKeyword, final ApiCallback<List<CampaignNegativeKeywordResponse>> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateCampaignNegativeKeywordsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, updateCampaignNegativeKeyword, _callback);
        Type localVarReturnType = new TypeToken<List<CampaignNegativeKeywordResponse>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
